package com.fili.gui.components;

import javax.swing.*;
import javax.swing.border.SoftBevelBorder;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 18, 2006
 * Time: 1:26:29 PM
 * Revision: 0
 */
public class StatusBar extends JComponent implements ActionListener
{
    private JLabel lblText;
    private JLabel lblClock;
    private Timer timer;
    
    public StatusBar()
    {
        setLayout(new BorderLayout());
        setBorder(new SoftBevelBorder(SoftBevelBorder.LOWERED));
        lblText = new JLabel("Pula mea");
        add(lblText,BorderLayout.WEST);

        lblClock = new JLabel();
        add(lblClock,BorderLayout.EAST);

        timer = new Timer(1000,this);
        timer.start();
    }

    public void actionPerformed(ActionEvent e)
    {
        SimpleDateFormat sdf = new SimpleDateFormat("H:mm:ss");

        lblClock.setText(sdf.format(new Date()));
    }
}
